/*
 * @Description:
 * @version:
 * @Author: 周凯
 * @Date: 2020-07-26 22:22:54
 * @LastEditors: 周凯
 * @LastEditTime: 2020-07-26 23:11:41
 */

import axios from "axios";

let util = {};

util.title = function(title) {
  title = title ? title + " - boblog.com " : "boblog.com 后台";
  window.document.title = title;
};

const ajaxUrl =
  process.env.NODE_ENV === "development"
    ? "http://localhost:3000/api/v1"
    : "http://xka.start6.cn/api/v1";

util.ajax_url = ajaxUrl;

util.ajax = axios.create({
  baseURL: ajaxUrl,
  timeout: 30000
});

export default util;
